Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 5 - Option Management / Option Management Reference
Constants and Data Types


Generic Options

Open Transport defines generic options, and you can use them with any protocol that understands them. The protocol level for each of these options is the same as the name of the protocol that supports them. The constant names used to specify generic options are given by the following enumeration:

enum
{
   OPT_CHECKSUM      = (OTXTIName)0x0600,
   OPT_RETRYCNT      = (OTXTIName)0x0601, 
   OPT_INTERVAL      = (OTXTIName)0x0602, 
   OPT_ENABLEEOM     = (OTXTIName)0x0603,
   OPT_SELFSEND      = (OTXTIName)0x0604,
   OPT_SERVERSTATUS  = (OTXTIName)0x0605,
   OPT_KEEPALIVE     = (OTXTIName)0x0008
};
Constant descriptions

OPT_CHECKSUM
A constant specifying whether checksums are performed. Specify 1 to turn the option on and 0 to turn it off. If you turn it on, a checksum is calculated when a packet is sent and recalculated when the packet is received. If the checksum values match, the client receiving the packet can be fairly certain that data has not been corrupted or lost during transmission. If the checksum values don't match, the function used to receive the packet returns an error.
This option is usually implemented by the lowest-level protocol, although you might be allowed to set it at a higher level. For example, if you use an ATP endpoint, you can set checksumming at the ATP level, even though it is implemented by the underlying DDP protocol.
This option is both association-related and not association-
related.
OPT_RETRYCNT
A positive integer specifying the number of times a function can attempt packet delivery before returning with an error. This option is usually implemented by connection-
oriented endpoints or connectionless transaction-based endpoints to enable reliable delivery of data. Such protocols normally set a default value for this option.
This option is both association-related and not association-
related.
OPT_INTERVAL
A positive integer specifying the interval of time that should elapse between attempts to deliver a packet. The number of attempts is defined by the OPT_RETRYCNT option.
This option is both association-related and not association-
related.
OPT_ENABLEEOM
A constant specifying end-of-message capability. If you set this option, you enable the use of the T_MORE flag with the OTSnd function to mark the end of a logical unit. This option has meaning only for connection-oriented protocols.
This option is not association-related.
OPT_SELFSEND
A constant allowing you to send broadcast packets to yourself.
OPT_SERVERSTATUS
A string that sets the server's status. The string's length must be between 0-255 bytes. The maximum length is protocol dependent. This option is used to set the status string that the server returns in response to a client's SendStatus call and is remembered internally on a per-socket basis.
OPT_KEEPALIVE
A keepalive structure (page 5-32) that specifies whether the option is turned on (T_YES) or off (T_NO) and specifies the timeout period in minutes.
Connection-oriented protocols can use this option to check that the connection is maintained. If a connection is established but there is no data being transferred, you can specify a time limit within which Open Transport checks to see that the remote end of the connection is still alive. If it is not, Open Transport tears down the connection.
This option is association-related.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996